package com.wlyuan.open.scanner.utils.enums.transport;

import com.wlyuan.core.marker.NamedValue;
import com.wlyuan.core.marker.NamedValueMap;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Map;

/**
 * @author lijing
 * @description 运单签收类型对应关系
 */
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public enum TransportSignTypeEnum implements NamedValue<Integer> {

    INIT(0, null, "初始化"),
    SCAN_SIGN(1, 1, "扫码签收"),
    OTHER(2, 2, "平台签收"),
    DRIVER(3, 6, "个体司机签收"),
    WXFHF(5, 5, "发货方小程序签收"),
    WXCYF(6, 6, "承运方小程序签收"),
    WXSHF(7, 7, "收货方小程序签收"),
    DEVICE_AUTO(99, 99, "电子回单自动签收");

    private final Integer value;
    private final Integer newValue;
    private final String name;

    private static final Map<Integer, TransportSignTypeEnum> MAP = new NamedValueMap<>(TransportSignTypeEnum.class);

    public static TransportSignTypeEnum fromValue(Integer value) {
        return MAP.get(value);
    }
}
